import create.Singleton1;
import create.Singleton2;
import factory.demo1.Coffee;
import factory.demo1.CoffeeStore;
import factory.factory_method.AmericanCoffeeFactory;
import factory.factory_method.CoffeeFactory;
import factory.factory_method.LatteCoffeeFactory;

public class Main {
    public static void main(String[] args) {
        Singleton1 singleton1 = Singleton1.getInstance();
        Singleton1 singleton2 = Singleton1.getInstance();

        Singleton2 singleton21 = Singleton2.getInstance();
        Singleton2 singleton22 = Singleton2.getInstance();
        if(singleton1 == singleton2) {
            System.out.print("true \n");
        }
        if (singleton21 == singleton22) {
            System.out.print("true \n");
        }

        CoffeeStore coffeeStore = new CoffeeStore();
        Coffee coffee = coffeeStore.orderCoffee("latte");
        coffee.getName();


        CoffeeFactory coffeeFactory1= new AmericanCoffeeFactory();
        CoffeeFactory coffeeFactory2= new LatteCoffeeFactory();
        factory.factory_method.CoffeeStore coffeeStore1 = new factory.factory_method.CoffeeStore();
        coffeeStore1.setFactory(coffeeFactory1);
        coffeeStore1.orderCoffee();

        coffeeStore1.setFactory(coffeeFactory2);
        coffeeStore1.orderCoffee();


    }
}